
import { Entity, NgField, NgObject, EntityList, NgList, NgDynamic, DynamicEntity, NgEntity } from '@farris/devkit';
import { ZzryEntity } from './zzryentity';
import { PathHierarchyInfo0086Entity } from './pathhierarchyinfo0086entity';

@NgEntity({
    originalCode: "zzgl",
    nodeCode: "zzgls",
    allowEmpty: true
})
export class ZzglEntity extends Entity {

    @NgField({
        originalDataField: 'ID',
        dataField: 'id',
        primary: true,
        originalDataFieldType: 'String',
        initValue: '',
        path: 'ID',

        validRules: [
            {
                type: 'required',
                constraints: [true],
            },
            {
                type: 'maxLength',
                constraints: [36],
                message: '最大长度为36',
            }
        ]
    })
    id: string;

    @NgField({
        originalDataField: 'Version',
        dataField: 'version',
        originalDataFieldType: 'DateTime',
        initValue: '0001-01-01T00:00:00',
        path: 'Version',
        enableTimeZone: true,
    })
    version: string;

    @NgField({
        originalDataField: 'ProjectID',
        dataField: 'projectID',
        originalDataFieldType: 'String',
        initValue: '',
        path: 'ProjectID',

        validRules: [
            {
                type: 'maxLength',
                constraints: [36],
                message: '最大长度为36',
            }
        ]
    })
    projectID: string;

    @NgField({
        originalDataField: 'zzbh',
        dataField: 'zzbh',
        originalDataFieldType: 'String',
        initValue: '',
        path: 'zzbh',

        validRules: [
            {
                type: 'maxLength',
                constraints: [36],
                message: '最大长度为36',
            }
        ]
    })
    zzbh: string;

    @NgField({
        originalDataField: 'zzmc',
        dataField: 'zzmc',
        originalDataFieldType: 'String',
        initValue: '',
        path: 'zzmc',

        validRules: [
            {
                type: 'maxLength',
                constraints: [512],
                message: '最大长度为512',
            }
        ]
    })
    zzmc: string;

    @NgField({
        originalDataField: 'zzlb',
        dataField: 'zzlb',
        originalDataFieldType: 'String',
        initValue: '',
        path: 'zzlb',

        validRules: [
            {
                type: 'maxLength',
                constraints: [50],
                message: '最大长度为50',
            }
        ]
    })
    zzlb: string;

    @NgField({
        originalDataField: 'ProjectNote',
        dataField: 'projectNote',
        originalDataFieldType: 'Text',
        initValue: '',
        path: 'ProjectNote',
    })
    projectNote: any;

    @NgField({
        originalDataField: 'fgld',
        dataField: 'fgld',
        originalDataFieldType: 'String',
        initValue: '',
        path: 'fgld',

        validRules: [
            {
                type: 'maxLength',
                constraints: [36],
                message: '最大长度为36',
            }
        ]
    })
    fgld: string;

    @NgField({
        originalDataField: 'fzr',
        dataField: 'fzr',
        originalDataFieldType: 'String',
        initValue: '',
        path: 'fzr',

        validRules: [
            {
                type: 'maxLength',
                constraints: [36],
                message: '最大长度为36',
            }
        ]
    })
    fzr: string;

    @NgField({
        originalDataField: 'sszz',
        dataField: 'sszz',
        originalDataFieldType: 'String',
        initValue: '',
        path: 'sszz',

        validRules: [
            {
                type: 'maxLength',
                constraints: [36],
                message: '最大长度为36',
            }
        ]
    })
    sszz: string;

    @NgField({
        originalDataField: 'wlgx',
        dataField: 'wlgx',
        originalDataFieldType: 'String',
        initValue: '',
        path: 'wlgx',

        validRules: [
            {
                type: 'maxLength',
                constraints: [36],
                message: '最大长度为36',
            }
        ]
    })
    wlgx: string;

    @NgList({
        dataField: 'zzrys',
        originalDataField: '',
        type: ZzryEntity

    })

    zzrys: EntityList<ZzryEntity>;
    @NgObject({
        dataField: 'fjxx',
        originalDataField: 'fjxx',
        hierarchyType:'path',
        type: PathHierarchyInfo0086Entity
    })
    fjxx: PathHierarchyInfo0086Entity;
}